package com.bana.fvs.app.mvp.model;


import com.bana.fvs.app.mvp.ConstantsValue;
import com.bana.fvs.app.mvp.IApiService;
import com.wei.commonlibrary.mvp.model.CommModelImpl;
import com.wei.commonlibrary.utils.GlobalContext;
import com.wei.commonlibrary.utils.SPUtils;

/**
 * Created by ${wei} on 2018/02/26.
 * <p>
 * 为了实现构造方法中传递的接口类的class
 */

public abstract class BaseModel extends CommModelImpl<IApiService> {

    public BaseModel() {
        super(IApiService.class);
    }

    @Override
    public String getBaseUrl() {
        if(!"".equals(SPUtils.getBaseUrl(GlobalContext.context))){
            return "http://"+SPUtils.getBaseUrl(GlobalContext.context)+":"+SPUtils.getBaseUrlPort(GlobalContext.context)+"/bana_fvs/";
        }

        return ConstantsValue.BASEURL+"bana_fvs/";
    }
}
